
*******************************************************
*	This files checks the correlations 
* 	of our data with Chain Store Guides data
*******************************************************
  
clear all
use CSG_Comparison

STOP STOP STOP

****************************************************************************************************
****Make some graphs
label var csg_frac "Fraction of Chain's Stores in a Given State - CSG Data"
label var dp_frac "Fraction of Chain's Stores in a Given State - Our Transaction Data"

binscatter dp_frac csg_frac, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction.png", replace

binscatter dp_frac csg_frac if csg_frac<.05, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_small.png", replace

binscatter dp_frac csg_frac if state=="ak", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_ak.png", replace

binscatter dp_frac csg_frac if state=="fl" & csg_frac<.15, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_fl.png", replace

binscatter dp_frac csg_frac if state=="ca" , xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_ca.png", replace

binscatter dp_frac csg_frac if state=="ny"& csg_frac<.15, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_ny.png", replace

binscatter dp_frac csg_frac if state=="wy", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_wy.png", replace

binscatter dp_frac csg_frac if state=="il", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_il.png", replace

binscatter dp_frac csg_frac if state=="nh", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_nh.png", replace

binscatter dp_frac csg_frac if state=="ne", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_ne.png", replace

binscatter dp_frac csg_frac if state=="sc", xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Stores in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_sc.png", replace


*************
**By revenue

binscatter rev_frac csg_frac, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Revenue in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_rev.png", replace

binscatter rev_frac csg_frac if csg_frac<.05, xtitle("% of Stores in a State - CSG", size(large)) ytitle("% of Revenue in a State - Observed", size(large)) ylabel(, labsize(large)) xlabel(, labsize(large))
graph export "Output/chain_store_state_fraction_small_rev.png", replace
